<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">
    <ui:composition template="/templete.xhtml">
        <ui:define name="conteudo">
            <p:panel header="Meus postos" style="width: 80%">
                <h:form>
                    <p:dataTable value="#{postoCtrl.listaPosto()}" var="posto" emptyMessage="Você não possui postos cadastrados"
                                 paginator="true" rows="5" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                 rowsPerPageTemplate="5,10,15">
                    <p:column>
                        <f:facet name="header">
                        Nome
                    </f:facet>
                        <h:outputText value="#{posto.pstNome}"/>
                    </p:column>
                     <p:column>
                        <f:facet name="header">
                        Sigla
                    </f:facet>
                         <h:outputText value="#{posto.pstSigla}"/>
                    </p:column>
                     <p:column>
                        <f:facet name="header">
                        Data Cadastro
                    </f:facet>
                         <h:outputText value="#{posto.pstDatacadastro}">
                             <f:convertDateTime pattern="dd/MM/yyyy"/>
                         </h:outputText>
                    </p:column>
                    <p:column>
                        <f:facet name="header">
                       Editar
                    </f:facet>
                        
                        <p:commandButton icon="ui-icon-pencil" update="@all" process="@all" actionListener="#{postoCtrl.editaPosto(posto)}"/>
                      
                    </p:column>
                    
                </p:dataTable>
                </h:form>
            </p:panel>
        </ui:define>
    </ui:composition>
</html>

